package site.marqstree.kotlin.usercenter.ui.activity.forgetpwd

import site.marqstree.kotlin.library.base.data.net.observer.RxObserver
import site.marqstree.kotlin.library.base.data.net.request.RxRequest
import site.marqstree.kotlin.library.base.extent.json2Boolean
import site.marqstree.kotlin.library.base.presenter.view.BasePresenter
import site.marqstree.kotlin.provider.common.ProviderConstant
import javax.inject.Inject


/*
 * 项目名: KotlinMall
 * 包名: site.marqstree.kotlin.usercenter.presenter.view
 * 文件名: ForgetPwdPresenter
 * 创建者: marqstree
 * 创建时间: 2020/2/22 16:41
 * 描述: TODO
 */
/*
    忘记密码Presenter
 */
class ForgetPwdPresenter @Inject constructor() : BasePresenter<ForgetPwdView>() {

    fun forgetPwd(mobile: String, verifyCode: String) {
        RxRequest.builder()
            .setUrl(ProviderConstant.FORGET_PWD_URL)
            .setParam("mobile",mobile)
            .setParam("verifycode",verifyCode)
            .post()
            .json2Boolean()
            .subscribe(object :RxObserver<Boolean>(){
                override fun onNext(data: Boolean) {
                    mView.onForgetPwdResult("验证成功")
                }
            })
    }

}